<form name="customer-assign" class="form-horizontal form-row-seperated validator-dialog form-ajax" action="<?=url('customer/assign')?>" method="post">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">
            <i class="fa fa-share"></i>
            <?=__('Customers Assign')?>
        </h4>
    </div>
    <div class="modal-body form">
        <? if ($customer_id): ?>
            <input type="hidden" name="customers[]" value="<?=$customer_id?>" />
        <? endif; ?>
        <div class="form-body">
            <div class="form-group">
                <label class="col-sm-4 control-label"><?=__('Select a assign batch')?>:</label>
                <div class="col-sm-8">
                    <select name="assign_id" class="form-control">
                        <? foreach ($assigns as $batch): ?>
                        <option value="<?=$batch['assign_id']?>">
                            <?=$batch['description']?> (<?=$batch['customers']?>)
                        </option>
                        <? endforeach; ?>
                    </select>
                    <span class="help-block" style="line-height:300%;">
                        <a href="javascript:;" id="create-new-batch" data-value="<?=date('Y-m-d')?>">
                            <i class="fa fa-plus"></i> <?=__('Create new assign batch')?>
                        </a>
                    </span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label"><?=__('Select assigned leader')?>:</label>
                <div class="col-sm-8">
                    <select name="manager_user_id" class="form-control">
                        <? foreach ($managers as $user): ?>
                        <option value="<?=$user['user_id']?>">
                            <?=OaUsers::getRealName($user)?>
                        </option>
                        <? endforeach; ?>
                    </select>
                </div>
            </div>
            <div class="form-group last">
                <label class="col-sm-4 control-label"><?=__('Select assigned sales')?>:</label>
                <div class="col-sm-8">
                    <select name="sales_user_id" class="form-control">
                        <? foreach ($sales as $user): ?>
                        <option value="<?=$user['user_id']?>" data-parent-id="<?=OaSales::getParentManager($user['user_id'])?>">
                            <?=OaUsers::getRealName($user)?>
                        </option>
                        <? endforeach; ?>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="submit" class="btn btn-primary">
            <i class="fa fa-check"></i>
            <?=__('Submit')?>
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal">
            <i class="fa fa-times"></i>
            <?=__('Close')?>
        </button>
    </div>
</form>
